Skip to content

[codegen] Support generic object property#22

Merged
edriouk merged 1 commit into
mainfrom
codegen-support-generic-object
Jul 23, 2025
Merged

[codegen] Support generic object property#22
edriouk merged 1 commit into
mainfrom
codegen-support-generic-object

Conversation

@brondani

@brondani brondani commented Jul 23, 2025

Copy link
Copy Markdown
Collaborator

Changes

  • Generate generic C++ map and TS Record for properties with type object and accepting additionalProperties.
    For example the following schema:
Device:
  type: object
  properties:
    name:
      type: string
    attributes:
      type: object
      additionalProperties:
        type: string
  required:
    - name
    - attributes

Results in the following interfaces for C++ and TS respectively:

struct Device {
  string name;
  map<string, string> attributes;
};
export interface Device {
    name: string,
    attributes: Record<string, string>,
}

Checklist

  • 🤖 This change is covered by unit tests (if applicable).
  • 🤹 Manual testing has been performed (if necessary).
  • 🛡️ Security impacts have been considered (if relevant).
  • 📖 Documentation updates are complete (if required).
  • 🧠 Third-party dependencies and TPIP updated (if required).

@brondani brondani requested a review from edriouk July 23, 2025 15:22
@edriouk edriouk merged commit 47b23a6 into main Jul 23, 2025
4 checks passed
@brondani brondani deleted the codegen-support-generic-object branch July 24, 2025 06:55
edriouk pushed a commit that referenced this pull request Jul 24, 2025
edriouk added a commit that referenced this pull request Jul 29, 2025
* Added GetDeviceList and GetDeviceData methods

and corresponding structures

* [codegen] Support generic `object` property (#22)

* Rename DevicesInfo into DeviceList

* Use id string

* Board data

* Apply suggestions from code review

Co-authored-by: Daniel Brondani <daniel.brondani@arm.com>

* Correct Board ID description

---------

Co-authored-by: Daniel Brondani <daniel.brondani@arm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants